package com.dcbeida.bean;

import android.support.annotation.ColorRes;

import com.dcbeida.R;

public enum SignStatusEnum {


    WQ(0,"未签", R.color.c_EB3030),
    YQ(1,"已签",R.color.c_21B1FF),
    JQ(2,"拒签",R.color.c_FF6600);




    private int type;

    private String name;


    @ColorRes
    private int color;


    SignStatusEnum(int type, String name,@ColorRes int color){
        this.type =type;
        this.name=name;
        this.color=color;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getColor() {
        return color;
    }

    public void setColor(int color) {
        this.color = color;
    }

    public  static SignStatusEnum getEnum(int type){
        for (SignStatusEnum value : SignStatusEnum.values()) {
             if(type == value.getType()){
                 return value;
             }
        }
        return WQ;
    }

    public  static String getCardName(int type){
        for (SignStatusEnum value : SignStatusEnum.values()) {
            if(type == value.getType()){
                return value.getName();
            }
        }
        return WQ.getName();
    }

}
